Public Class Skype
    Dim nabapi As New Nabaztag_API
    Dim messagesent As Integer = 0
    Dim Skypeapp As New SKYPE4COMLib.Skype
    Dim Missedcalls As Integer
    Dim Sky As New SKYPE4COMLib.Client

    Private Sub Skype_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        Dim keyValue As String
        keyValue = My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\Software\Skype\Phone\", "SkypePath", "NULL")

        If keyValue = "NULL" Then
            MsgBox("Skype Not Installed. Quitting ! Install Skype from www.skype.com")
            Me.Close()
        Else

            Refresh()
            'Timer1.Interval = 6000
            Timer1.Interval = NumericUpDown1.Value * 60000

            Timer1.Start()
            Timer2.Interval = 360000

        End If



    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        Refresh()
    End Sub

    Public Sub Refresh()

        TextBox1.Text = Skypeapp.MissedCalls.Count.ToString()
        Dim sky As New SKYPE4COMLib.Call

        Missedcalls = Skypeapp.MissedCalls.Count.ToString()


        Dim i As Integer
        If Missedcalls = 0 Then
            messagesent = 0


        Else


            If Missedcalls > 0 Then
                ListView1.Clear()

                For i = 1 To Missedcalls
                    ListView1.Items.Add(Skypeapp.MissedCalls.Item(i).PartnerDisplayName.ToString)
                Next

                If messagesent = 0 Then
                    nabapi.sendapi("You have" & Missedcalls & " missed calls on Skype", Form1.serial.Text, Form1.token.Text, "Heather")
                    messagesent = 1

                End If
            End If
        End If

    End Sub

    Private Sub GroupBox1_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GroupBox1.Enter

    End Sub

    Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
        messagesent = 0
    End Sub

    Private Sub RichTextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RichTextBox1.TextChanged

    End Sub
End Class